package com.example.demo.mapper;

import com.example.demo.entity.UserInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface UserInfoMapper {

    @Select("select * from userinfo where name=#{name}")
    UserInfo selectByName(String name);

    @Update("update userinfo set email=#{email},age=#{age},sex=#{sex} where name=#{name}")
    int updateInfo(String email,int age,int sex,String name);

    @Insert("insert into userinfo(name,email,age,sex) values(#{name},#{email},#{age},#{sex}})")
    int registers(UserInfo u);
}
